class Solution
{
public:
    bool isPrefixString(string s, vector<string> &words)
    {
        string pre = "";
        if (s == pre)
        {
            return true;
        }
        for (auto &word : words)
        {
            pre += word;
            if (s == pre)
            {
                return true;
            }
        }
        return false;
    }
};